package com.xiaofan.controller;

import com.xiaofan.bean.User;
import com.xiaofan.bean.VO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Arrays;
import java.util.List;

/**
 * @author: 晓帆
 * @description:
 * @create: 2021-06-30 21:15
 **/
@Controller
@RequestMapping("user")
public class UserController {
    @ResponseBody
    @RequestMapping("quick")
    public String add() {
        return "ni hao";
    }

    @ResponseBody
    @RequestMapping("quick2")
    public User say() {
        User user = new User();
        user.setUsername("xsa");
        user.setAge(11);
        return user;
    }
    @ResponseBody
    @RequestMapping("quick3")
    public void say1(String username,int age) {
        System.out.println(username);
        System.out.println(age);
    }
    @ResponseBody
    @RequestMapping("quick4")
    public void say1(User user) {
        System.out.println(user);
    }
    @ResponseBody
    @RequestMapping("quick5")
    public void say1(String[] strs) {
        System.out.println(Arrays.asList(strs));
    }
    @ResponseBody
    @RequestMapping("quick6")
    public void say1(@RequestBody List<User> user) {
        System.out.println(user);
    }
}
